package com.audaque.springboot.foshanupload.web.servletdemo.controller.forward;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/forward/b")
public class BServlet extends HttpServlet{
	private static final long serialVersionUID = 4092189978920257250L;

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("...b");
		PrintWriter out=resp.getWriter();
		//请求转发的特点:3.最终的响应由最后的组件决定(所有通常不需要在前面的组件中给浏览器响应)
		out.print("...b");
		//请求转发的特点:2.既然是一次请求,那么可以在这之间的web组件中共享数据
		System.out.println("a---"+req.getParameter("name"));
		//请求转发的特点:6.跳转前后地址栏中的地址没有改变
	}
}
